package com.ssm.service.impl;

import com.ssm.mapper.StudentMapper;
import com.ssm.pojo.Student;
import com.ssm.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public int addStudent(Student student) {
        return studentMapper.addStudent(student);
    }

    @Override
    public Integer isExist(Student student) {
        return studentMapper.isExist(student);
    }

    @Override
    public Integer StudentLogin(String userName, String passWord) {
        return studentMapper.StudentLogin(userName,passWord);
    }

    @Override
    public Integer AdminLogin(String userName, String passWord) {
        return studentMapper.AdminLogin(userName,passWord);
    }

    @Override
    public Integer getStuIdByStuNumber(String userName) {
        return studentMapper.getStuIdByStuNumber(userName);
    }

    @Override
    public Student selectStudent(String stuNumber) {
        return studentMapper.selectStudent(stuNumber);
    }

    @Override
    public Integer updatePersonMessage(String stuName, String passWord, int buildNumber, String tel,String stuNumber) {
        return studentMapper.updatePersonMessage(stuName,passWord,buildNumber,tel,stuNumber);
    }

    @Override
    public Integer updateMoney(String money,String stuNumber) {
        return studentMapper.addMoney(money,stuNumber);
    }

    @Override
    public List<Student> selectUsers() {
        return studentMapper.selectUsers();
    }

    @Override
    public List<Student> selectByStuNumber(Integer stuNumber) {
        return studentMapper.selectNumber(stuNumber);
    }

    @Override
    public List<Student> selectByStuId(Integer stuId) {
        return studentMapper.selectByStuId(stuId);
    }

    @Override
    public List<Student> selectByStuIdAndStuNumber(Integer stuId, Integer stuNumber) {
        return studentMapper.selectByStuIdAndStuNumber(stuId,stuNumber);
    }

}
